<template>
  <div class="search-container" @keyup.enter="getPipelineList">
    <div class="title-container">
      <div class="title">管线</div>
    </div>
    <el-form :inline="true" size="large" :form="pipelineSearchForm" class="search-form">
      <el-input v-model="pipelineSearchForm.name" placeholder="名称" :prefix-icon="Search" />
      <el-input
        v-model="pipelineSearchForm.stationName"
        placeholder="所属站场"
        :prefix-icon="Search"
      />
      <el-input v-model="pipelineSearchForm.type" placeholder="类型" :prefix-icon="Search" />
      <el-input v-model="pipelineSearchForm.length" placeholder="长度" :prefix-icon="Search" />
      <el-input v-model="pipelineSearchForm.radius" placeholder="半径" :prefix-icon="Search" />
      <el-select v-model="pipelineSearchForm.status" placeholder="状态" clearable>
        <el-option label="正常" :value="1" />
        <el-option label="停用" :value="0" />
      </el-select>
      <el-input
        v-model="pipelineSearchForm.createTime"
        placeholder="创建时间"
        :prefix-icon="Search"
      />
      <el-button type="primary" :icon="Search" class="btn" @click="getPipelineList">
        搜索
      </el-button>
    </el-form>
  </div>
</template>
<script setup name="PipelineSearchCom">
import { usePipeline } from '../hooks/usePipeline'
import { Search } from '@element-plus/icons-vue'
const { pipelineSearchForm, getPipelineList } = usePipeline()
</script>
<style lang="less" scoped>
.search-container {
  display: grid;
  grid-template-columns: 1fr 10fr;
  padding: 20px;
  .title-container {
    position: relative;
    .title {
      position: absolute;
      left: 0;
      top: 0;
      color: #303133;
      font-size: 16px;
      font-weight: bold;
    }
  }
  .search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 10px;
  }
}
</style>
